/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.gm.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Med EL MOUDDENE
 */
@Entity
@Table(name = "bilan")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Bilan.findAll", query = "SELECT b FROM Bilan b"),
    @NamedQuery(name = "Bilan.findByIdBilan", query = "SELECT b FROM Bilan b WHERE b.idBilan = :idBilan")})
public class Bilan implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID_BILAN")
    private Integer idBilan;
    @Lob
    @Size(max = 65535)
    @Column(name = "RESULTAT")
    private String resultat;
    @JoinColumn(name = "ID_DOSSIER", referencedColumnName = "ID_DOSSIER")
    @ManyToOne(optional = false)
    private DossierMedical idDossier;

    public Bilan() {
    }

    public Bilan(Integer idBilan) {
        this.idBilan = idBilan;
    }

    public Integer getIdBilan() {
        return idBilan;
    }

    public void setIdBilan(Integer idBilan) {
        this.idBilan = idBilan;
    }

    public String getResultat() {
        return resultat;
    }

    public void setResultat(String resultat) {
        this.resultat = resultat;
    }

    public DossierMedical getIdDossier() {
        return idDossier;
    }

    public void setIdDossier(DossierMedical idDossier) {
        this.idDossier = idDossier;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idBilan != null ? idBilan.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Bilan)) {
            return false;
        }
        Bilan other = (Bilan) object;
        if ((this.idBilan == null && other.idBilan != null) || (this.idBilan != null && !this.idBilan.equals(other.idBilan))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.gm.entities.Bilan[ idBilan=" + idBilan + " ]";
    }
    
}
